package com.zxy.personage.service.impl;

import org.springframework.stereotype.Service;
import java.util.Map;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.zxy.common.utils.PageUtils;
import com.zxy.common.utils.Query;

import com.zxy.personage.dao.RemarkDao;
import com.zxy.personage.entity.RemarkEntity;
import com.zxy.personage.service.RemarkService;


@Service("remarkService")
public class RemarkServiceImpl extends ServiceImpl<RemarkDao, RemarkEntity> implements RemarkService {

    @Override
    public PageUtils queryPage(Map<String, Object> params) {
        QueryWrapper<RemarkEntity> wrapper = new QueryWrapper<>();
        String status = (String) params.get("status");
        if (status!=null&&status!=""){
            int s = Integer.parseInt(status);
            wrapper.eq("status",s);
        }
        IPage<RemarkEntity> page = this.page(
                new Query<RemarkEntity>().getPage(params),
               wrapper
        );

        return new PageUtils(page);
    }

}